
#include "GameEngine.h"

#include <list>

//(level 2 code)

class Point {
	Point(Vector _vPos, Scalar _fMass, bool _bIsStatic) : vPos(_vPos), vOldPos(_vPos), vForce(0), fMass(_fMass), bIsStatic(_bIsStatic) 			{}
	Vector vPos;
	Vector vOldPos;
	Vector vForce;
	Scalar fMass;
	bool bIsStatic;
};

class IConstraint
{
	Constraint(Point* _pPoint1, Point* _pPoint2, Scalar _fLength) : pPoint1(_pPoint1), pPoint2(_pPoint2), fLength(_fLength) 		{}
	Point* pPoint1;
	Point* pPoint2;

public:
	
	
	
};

class LengthConstraint : public Constraint

class VerletBodyEntity
{
	
	struct Point {
		tPoint(Vector _vPos, Scalar _fMass, bool _bIsStatic) : vPos(_vPos), vOldPos(_vPos), vForce(0), fMass(_fMass), bIsStatic(_bIsStatic) 			{}
		Vector vPos;
		Vector vOldPos;
		Vector vForce;
		Scalar fMass;
		bool bIsStatic;
	};
	
	
	typedef std::list<Point*> PointGroup;
	typedef std::list<Point*>::iterator PointIterator;
	typedef std::list<Constraint*> ConstraintGroup;
	typedef std::list<Constraint*>::iterator ConstraintIterator;
	
	PointGroup m_pPoints;
	ConstraintGroup m_pConstraints;
	
public:
	
	virtual void update(Scalar fTimeStep);
	virtual void draw();
	
};
